package cn.yuan.xiaoyu.testmodule.activity;

import android.content.Intent;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.OnClick;
import cn.yuan.xiaoyu.R;
import cn.yuan.xiaoyu.commonmodule.activity.BaseActivity;
import cn.yuan.xiaoyu.testmodule.adapter.TestSettingAdapter;

/**
 * Created by yukuoyuan on 2017/9/20.
 * 这是一个跳转系统设置界面的测试类
 */
public class TestSettingActivity extends BaseActivity implements TestSettingAdapter.OnItemClickListener {
    @Bind(R.id.tv_toolbar_left)
    TextView tvToolbarLeft;
    @Bind(R.id.tv_toolbar_title)
    TextView tvToolbarTitle;
    @Bind(R.id.rcv_test_setting)
    RecyclerView rcvTestSetting;

    @Override
    protected void bindPresenter() {
    }

    @Override
    protected void initData(Bundle extras) {
        rcvTestSetting.setLayoutManager(new LinearLayoutManager(this));
        TestSettingAdapter testSettingAdapter = new TestSettingAdapter();
        rcvTestSetting.setAdapter(testSettingAdapter);
        testSettingAdapter.setData(getListData());
        testSettingAdapter.notifyDataSetChanged();
        testSettingAdapter.setOnItemClickListener(this);
    }

    private List<String> getListData() {
        List<String> testsetting = new ArrayList<>();
        testsetting.add("系统设置界面");
        testsetting.add("APN设置界面");
        testsetting.add("定位设置界面");
        testsetting.add("更多连接方式");
        testsetting.add("更多连接方式设置界面");
        testsetting.add("双卡和移动网络设置界面");
        testsetting.add("无障碍设置界面");
        testsetting.add("同步设置界面");
        testsetting.add("添加账户界面");
        testsetting.add("选取运营商的界面");
        testsetting.add("安全设置界面");
        testsetting.add("备份重置设置界面");
        testsetting.add("VPN设置界面,可能不存在");
        testsetting.add("无线网设置界面");
        testsetting.add("WIFI的IP设置");
        testsetting.add("蓝牙设置");
        testsetting.add("投射设置");
        testsetting.add("日期时间设置");
        testsetting.add("声音设置");
        testsetting.add("显示设置");
        testsetting.add("语言设置");
        testsetting.add("辅助应用和语音输入设置");
        testsetting.add("语言和输入法设置");
        testsetting.add("个人字典设置界面");
        testsetting.add("存储空间设置的界面");
        testsetting.add("搜索设置界面");
        testsetting.add("开发者选项设置");
        testsetting.add("手机状态信息的界面");
        testsetting.add("互动屏保设置的界面");
        testsetting.add("通知使用权设置的界面");
        testsetting.add("勿扰权限设置的界面");
        testsetting.add("字幕设置的界面");
        testsetting.add("打印设置界面");
        testsetting.add("节电助手界面");
        testsetting.add("主屏幕设置界面");
        return testsetting;
    }

    @Override
    public int getContentLayout() {
        return R.layout.activity_test_settiing;
    }

    @Override
    protected void initToolbar() {
        tvToolbarLeft.setVisibility(View.VISIBLE);
    }


    @OnClick({R.id.tv_toolbar_title})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_toolbar_title:
                onBackPressed();
                break;
        }
    }

    @Override
    public void OnItemClick(int position) {
        switch (position) {
            case 0:
                startActivity(new Intent(Settings.ACTION_SETTINGS));
                break;
            case 1:
                startActivity(new Intent(Settings.ACTION_APN_SETTINGS));
                break;
            case 2:
                startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));

                break;
            case 3:
               // startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));

                break;
            case 4:
                startActivity(new Intent(Settings.ACTION_AIRPLANE_MODE_SETTINGS));

                break;
            case 5:
                startActivity(new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS));

                break;
            case 6:
                startActivity(new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS));

                break;
            case 7:
                startActivity(new Intent(Settings.ACTION_SYNC_SETTINGS));

                break;
            case 8:
                startActivity(new Intent(Settings.ACTION_ADD_ACCOUNT));

                break;
            case 9:
                startActivity(new Intent(Settings.ACTION_NETWORK_OPERATOR_SETTINGS));

                break;
            case 10:
                startActivity(new Intent(Settings.ACTION_SECURITY_SETTINGS));

                break;
            case 11:
                startActivity(new Intent(Settings.ACTION_PRIVACY_SETTINGS));

                break;
            case 12:
                startActivity(new Intent(Settings.ACTION_VPN_SETTINGS));

                break;
            case 13:
                startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));

                break;
            case 14:
                startActivity(new Intent(Settings.ACTION_WIFI_IP_SETTINGS));

                break;
            case 15:
                startActivity(new Intent(Settings.ACTION_BLUETOOTH_SETTINGS));
                break;
            case 16:
                startActivity(new Intent(Settings.ACTION_CAST_SETTINGS));
                break;
            case 17:
                startActivity(new Intent(Settings.ACTION_DATE_SETTINGS));
                break;
            case 18:
                startActivity(new Intent(Settings.ACTION_SOUND_SETTINGS));
                break;
            case 19:
                startActivity(new Intent(Settings.ACTION_DISPLAY_SETTINGS));
                break;
            case 20:
                startActivity(new Intent(Settings.ACTION_LOCALE_SETTINGS));
                break;
            case 21:
                startActivity(new Intent(Settings.ACTION_VOICE_INPUT_SETTINGS));
                break;
            case 22:
                startActivity(new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS));
                break;
            case 23:
                startActivity(new Intent(Settings.ACTION_USER_DICTIONARY_SETTINGS));
                break;
            case 24:
                startActivity(new Intent(Settings.ACTION_INTERNAL_STORAGE_SETTINGS));
                break;
            case 25:
                startActivity(new Intent(Settings.ACTION_SEARCH_SETTINGS));
                break;
            case 26:
                startActivity(new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS));
                break;
            case 27:
                startActivity(new Intent(Settings.ACTION_DEVICE_INFO_SETTINGS));
                break;
            case 28:
                startActivity(new Intent(Settings.ACTION_DREAM_SETTINGS));
                break;
            case 29:
                startActivity(new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS));
                break;
            case 30:
                startActivity(new Intent(Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS));
                break;
            case 31:
                startActivity(new Intent(Settings.ACTION_CAPTIONING_SETTINGS));
                break;
            case 32:
                startActivity(new Intent(Settings.ACTION_PRINT_SETTINGS));
                break;
            case 33:
                startActivity(new Intent(Settings.ACTION_BATTERY_SAVER_SETTINGS));
                break;
            case 34:
                startActivity(new Intent(Settings.ACTION_HOME_SETTINGS));
                break;

        }
    }
}
